home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Medal Software 2
/
Gold Medal Software Volume 2 (Gold Medal) (1994).iso
/
windows
/
win31
/
macsyma.arj
/
MACSDEMO.EXE
/
DEFINT.OUT
< prev
next >
Wrap
Text File
|
1993-09-14
|
10KB
|
264 lines
(c1) /* DEMONSTRATION OF THE BASIC DEFINITE INTEGRATION CAPABILITIES OF MACSYMA
The Macsyma integrator sometimes needs to know the signs of certain
quantities. For the purposes of this demonstration, we will assume
that all symbolic parameters are positive. If you would like to see
the full capabilities of the integrator, you should run these problems
again with ASSUME_POS:FALSE$
*/
(assume_pos:true, showtime:true)$
Time= 0 msecs
(c2) /* Some integrals on a semi-infinite line: */
exp: sin(r*x)/x;
Time= 0 msecs
|$label(0,15,Times New Roman,$(d2$))$q(sin$paren(r$in( )x),x)
(c3) integrate(exp,x,0,inf);
Time= 649 msecs
|$label(0,15,Times New Roman,$(d3$))$q($greektext(p),2)
(c4) exp: sin(q*x)^2/(x^2);
Time= 0 msecs
|$label(0,15,Times New Roman,$(d4$))$q($sup(sin,2)$paren(q$in( )x),$sup(x,2))
(c5) integrate(exp,x,0,inf);
Time= 1429 msecs
|$label(0,15,Times New Roman,$(d5$))$q($greektext(p)$in( )q,2)
(c6) exp: a/(x^2+a^2);
Time= 0 msecs
|$label(0,15,Times New Roman,$(d6$))$q(a,$sup(x,2)$in( + )$sup(a,2))
(c7) integrate(exp,x,0,inf);
Time= 329 msecs
|$label(0,15,Times New Roman,$(d7$))$q($greektext(p),2)
(c8) /* An integral over a finite interval, with a singular integrand: */
exp: 1/sqrt(1-x);
Time= 0 msecs
|$label(0,15,Times New Roman,$(d8$))$q(1,$sqrt(1$in( - )x))
(c9) integrate(exp,x,0,1);
Time= 1529 msecs
|$label(0,15,Times New Roman,$(d9$))2
(c10) /* For this problem, Macsyma will ask the sign of a more complicated
quantity. Any answer will do, but we can also make an assumption in
advance, and then the query will not happen. */
exp: 1/(a*x^2+b*x+c);
Time= 0 msecs
|$label(0,15,Times New Roman,$(d10$))$q(1,a$in( )$sup(x,2)$in( + )b$in( )x$in( + )c)
(c11) assume(4*a*c-b^2>0)$
Time= 59 msecs
(c12) integrate(exp,x,minf,inf);
C:\MACSD2B\library1\residu.fas being loaded.
Time= 2139 msecs
|$label(0,15,Times New Roman,$(d12$))$q(2$in( )$greektext(p),$sqrt(4$in( )a$in( )c$in( - )$sup(b,2)))
(c13) /* MACSYMA can integrate user-defined functions. */
i(r,s,t):=(k^2+a^2)^(-r)*(k^2+b^2)^(-s)*(k^2+c^2)^(-t);
Time= 0 msecs
|$label(0,15,Times New Roman,$(d13$))i$paren(r$ina($, )$hinge()s$ina($, )$hinge()t)$hinge()$in( := )$sup($paren($sup(k,2)$in( + )$sup(a,2),$(,$)),$in( - )r)$in( )$sup($paren($sup(k,2)$in( + )$sup(b,2),$(,$)),$in( - )s)$in( )$sup($paren($sup(k,2)$in( + )$sup(c,2),$(,$)),$in( - )t)
(c14) /* Answer the question any way you like. */
integrate(i(1,1,0),k,0,inf);
|$label(-1,15,Times New Roman,)Is $in() $in()b$in( - )a$in() $in() positive or negative?
P;
Time= 25699 msecs
|$label(0,15,Times New Roman,$(d14$))$q($greektext(p),2$in( )a$in( )$paren(b$in( - )a,$(,$))$in( )$paren(b$in( + )a,$(,$)))$hinge()$in( - )$q($greektext(p),2$in( )b$in( )$paren(b$in( - )a,$(,$))$in( )$paren(b$in( + )a,$(,$)))
(c15) /* The integrator also examines characteristics of symbolic quantities. */
declare([m,n],even)$
Time= 0 msecs
(c16) exp: cos(x)^m*sin(x)^n;
Time= 0 msecs
|$label(0,15,Times New Roman,$(d16$))$sup(cos,m)$paren(x)$hinge()$in( )$sup(sin,n)$paren(x)
(c17) integrate(exp,x,0,2*%pi);
Time= 1980 msecs
|$label(0,15,Times New Roman,$(d17$))2$hinge()$in( )$greektext(B)$paren($q(m$in( + )1,2)$ina($, )$hinge()$q(n$in( + )1,2))
(c18) /* It knows how to integrate expressions involving the error function ... */
integrate(%e^(-x^2),x,0,inf);
Time= 709 msecs
|$label(0,15,Times New Roman,$(d18$))$q($sqrt($greektext(p)),2)
(c19) integrate((x^3-a*x+b)*%e^(-x^2+b*x+c),x,minf,inf);
Time= 2909 msecs
|$label(0,15,Times New Roman,$(d19$))$q($paren($sqrt($greektext(p))$in( )$paren($sup(b,3)$in( + )$paren(8$in( - )4$in( )a,$(,$))$in( )b,$(,$))$in( + )6$in( )$sqrt($greektext(p))$in( )b,$(,$))$in( )$sup($e(),$q(4$in( )c$in( + )$sup(b,2),4)),8)
(c20) /* ... logarithms ... */
declare(k,integer)$
Time= 0 msecs
(c21) exp: log(x)^k;
Time= 0 msecs
|$label(0,15,Times New Roman,$(d21$))$sup(log,k)$paren(x)
(c22) integrate(exp,x,0,1);
Time= 3569 msecs
|$label(0,15,Times New Roman,$(d22$))$sup($paren($in( - )1,$(,$)),k)$hinge()$in( )k!
(c23) exp:log(x)^2/(x^2+1);
Time= 0 msecs
|$label(0,15,Times New Roman,$(d23$))$q($sup(log,2)$paren(x),$sup(x,2)$in( + )1)
(c24) integrate(exp,x,0,inf);
Time= 6590 msecs
|$label(0,15,Times New Roman,$(d24$))$q($sup($greektext(p),3),8)
(c25) exp: log(1/x)*x^m/sqrt(1-x);
Time= 0 msecs
|$label(0,15,Times New Roman,$(d25$))$in( - )$q($sup(x,m)$in( )log$paren(x),$sqrt(1$in( - )x))
(c26) integrate(exp,x,0,1);
C:\MACSD2B\library1\specfn.fas being loaded.
Time= 3960 msecs
|$label(0,15,Times New Roman,$(d26$))$in( - )$greektext(B)$paren($q(1,2)$ina($, )$hinge()m$in( + )1)$in( )$paren($sub($greektext(y),0)$paren(m$in( + )1)$in( - )$sub($greektext(y),0)$paren(m$in( + )$q(3,2)),$(,$))
(c27) /* ... trigonometric functions ... */
exp: cos(x)^2-sin(x);
Time= 0 msecs
|$label(0,15,Times New Roman,$(d27$))$sup(cos,2)$paren(x)$hinge()$in( - )sin$paren(x)
(c28) integrate(exp,x,0,2*%pi);
Time= 6649 msecs
|$label(0,15,Times New Roman,$(d28$))$greektext(p)
(c29) exp: cos(x)^3*sin(x)^2;
Time= 0 msecs
|$label(0,15,Times New Roman,$(d29$))$sup(cos,3)$paren(x)$hinge()$in( )$sup(sin,2)$paren(x)
(c30) integrate(exp,x,3*%pi/2,3*%pi);
Time= 5649 msecs
|$label(0,15,Times New Roman,$(d30$))$q(2,15)
(c31) exp: cos(x)^(1/3)*sin(x)^2;
Time= 59 msecs
|$label(0,15,Times New Roman,$(d31$))$sup(cos,1$in(/)3)$paren(x)$hinge()$in( )$sup(sin,2)$paren(x)
(c32) integrate(exp,x,-%pi/2,%pi/2);
Time= 3569 msecs
|$label(0,15,Times New Roman,$(d32$))$greektext(B)$paren($q(2,3)$ina($, )$hinge()$q(3,2))
(c33) sin(x)^(1/3)*cos(x)^(1/2);
Time= 0 msecs
|$label(0,15,Times New Roman,$(d33$))$sqrt(cos$paren(x))$hinge()$in( )$sup(sin,1$in(/)3)$paren(x)
(c34) integrate(%,x,0,%pi/2);
Time= 2089 msecs
|$label(0,15,Times New Roman,$(d34$))$q($greektext(B)$paren($q(2,3)$ina($, )$hinge()$q(3,4)),2)
(c35) /* ... and hyperbolic trigonometric functions. */
exp: x/(sinh(x)-%i);
Time= 0 msecs
|$label(0,15,Times New Roman,$(d35$))$q(x,sinh$paren(x)$in( - )$italictext(i))
(c36) integrate(exp,x,minf,inf);
Time= 13570 msecs
|$label(0,15,Times New Roman,$(d36$))$greektext(p)
(c37) /* Intricate singularity structure: */
exp: 1/((1+x)*x^(1/2));
Time= 0 msecs
|$label(0,15,Times New Roman,$(d37$))$q(1,$sqrt(x)$in( )$paren(x$in( + )1,$(,$)))
(c38) integrate(exp,x,0,inf);
Time= 929 msecs
|$label(0,15,Times New Roman,$(d38$))$greektext(p)
(c39) exp: x^(-1/2)/(a*x^3+3)^5;
Time= 0 msecs
|$label(0,15,Times New Roman,$(d39$))$q(1,$sqrt(x)$in( )$sup($paren(a$in( )$sup(x,3)$in( + )3,$(,$)),5))
(c40) integrate(exp,x,0,inf);
Time= 1649 msecs
|$label(0,15,Times New Roman,$(d40$))$q(21505$in( )$greektext(p),3779136$in( )$sup(3,5$in(/)6)$in( )$sup(a,1$in(/)6))
(c41) /* These examples illustrate use of contour integral methods. */
exp: (x^2+a*x+b)/(x^4+10*x^2+9);
Time= 0 msecs
|$label(0,15,Times New Roman,$(d41$))$q($sup(x,2)$in( + )a$in( )x$in( + )b,$sup(x,4)$in( + )10$in( )$sup(x,2)$in( + )9)
(c42) integrate(exp,x,minf,inf);
Time= 990 msecs
|$label(0,15,Times New Roman,$(d42$))$q($greektext(p)$in( )$paren($in( - )$italictext(i)$in( )$paren($italictext(i)$in( )$paren(b$in( - )1,$(,$))$in( - )a,$(,$))$in( - )$italictext(i)$in( )$paren(a$in( - )$q($italictext(i)$in( )$paren(b$in( - )9,$(,$)),3),$(,$)),$(,$)),8)
(c43) integrate(exp,x,0,inf);
Time= 5330 msecs
|$label(0,15,Times New Roman,$(d43$))$q($greektext(p)$in( )b,24)$hinge()$in( + )$q(log$paren(3)$in( )a,8)$hinge()$in( + )$q($greektext(p),8)
(c44) /* These examples have singularities on the integration path. */
exp: 1/x;
Time= 0 msecs
|$label(0,15,Times New Roman,$(d44$))$q(1,x)
(c45) integrate(exp,x,-1,1);
Principal value.
Time= 3239 msecs
|$label(0,15,Times New Roman,$(d45$))0
(c46) integrate(exp,x,-a,a);
Principal value.
Time= 4059 msecs
|$label(0,15,Times New Roman,$(d46$))0
(c47) exp: sin(4*x)/(x^(1/2));
Time= 0 msecs
|$label(0,15,Times New Roman,$(d47$))$q(sin$paren(4$in( )x),$sqrt(x))
(c48) integrate(exp,x,0,inf);
Time= 1099 msecs
|$label(0,15,Times New Roman,$(d48$))$q($sqrt(2)$in( )$sqrt($greektext(p)),4)
(c49) /* Explicitly complex quantities are also treated. */
exp: sin(x)/(x^2+1)*%e^(-2*%i*x);
Time= 0 msecs
|$label(0,15,Times New Roman,$(d49$))$q($sup($e(),$in( - )2$in( )$italictext(i)$in( )x)$in( )sin$paren(x),$sup(x,2)$in( + )1)
(c50) integrate(exp,x,minf,inf);
Time= 2259 msecs
|$label(0,15,Times New Roman,$(d50$))$in( - )$q($sup($e(),$in( - )3)$in( )$paren($sup($e(),2)$in( - )1,$(,$))$in( )$italictext(i)$in( )$greektext(p),2)
(c51) exp: (1-%i*u)^(-1)*exp(-%i*x*u)/(2*%pi);
Time= 59 msecs
|$label(0,15,Times New Roman,$(d51$))$q($sup($e(),$in( - )$italictext(i)$in( )u$in( )x),2$in( )$greektext(p)$in( )$paren(1$in( - )$italictext(i)$in( )u,$(,$)))
(c52) defint(exp,u,minf,inf);
Time= 3509 msecs
|$label(0,15,Times New Roman,$(d52$))$sup($e(),$in( - )x)
(c53) /* The following integration returns the noun form not because
MACSYMA cannot do the integral but because INTANALYSIS is TRUE (which
is its default) and MACSYMA cannot determine whether there are poles
in the interval of integration. A message to this effect is printed.
To suppress the message, set INTANALYSIS_WARN to FALSE. Setting
INTANALYSIS to FALSE allows MACSYMA to proceed with the integration. */
integrate(x*csch(x)*sech(x+a),x,minf,inf),intanalysis:true;
INTEGRATE could not determine whether there are poles in the
interval of integration.
Continuing...
Time= 17909 msecs
|$label(0,15,Times New Roman,$(d53$))$q(8$in( )$greektext(p)$in( )$paren(4$in( )$sup(a,2)$in( + )$sup($greektext(p),2),$(,$))$in( )$sup($e(),a),16$in( )$greektext(p)$in( )$sup($e(),2$in( )a)$in( + )16$in( )$greektext(p))
(c54) factor(integrate(x*csch(x)*sech(x+a),x,minf,inf)),intanalysis:false;
Time= 10379 msecs
|$label(0,15,Times New Roman,$(d54$))$q($paren(4$in( )$sup(a,2)$in( + )$sup($greektext(p),2),$(,$))$in( )$sup($e(),a),2$in( )$paren($sup($e(),2$in( )a)$in( + )1,$(,$)))
(c55) is(% = factor(exponentialize((a^2+%pi^2/4)*sech(a))));
Time= 159 msecs
|$label(0,15,Times New Roman,$(d55$))true
(c56) /* Cleanup */
(reset(assume_pos,showtime), remvalue(exp), remfunction(i),
forget(4*a*c-b^2>0), remove([m,n],even,k,integer))$